package video.dali.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import video.dali.common.entity.User;

import java.util.List;

@Mapper
public interface UserMapper {

    /**
     * 用户登录
     * @param user
     */
    void insert(User user);

    /**
     * 删除用户
     * @param ids
     */
    void deleteByIds(List<Integer>  ids);



    /**
     * 根据username查询
     * @param username
     * @return
     */
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);


    /**
     * 根据username删除用户
     * @param username
     */
    @Delete("delete from user where username = #{username}")
    void deleteByUsername(String username);


    /**
     * 更新用户信息
     * @param user
     */
    void update(User user);
}
